package com.itheima;

import java.io.OutputStream;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;
import java.util.stream.Stream;

public class Demo6 {
    public static void main(String[] args) {
        List<String> list = new ArrayList<>();
        ArrayList<Person> people = new ArrayList<>();

        list.add("王佳乐");
        list.add("张三丰");
        list.add("王思聪");
        list.add("张飞");

        list.stream().forEach(name -> {
            Person person = new Person(name);
            people.add(person);
        });
        people.stream().forEach(person -> System.out.println(person));
    }
}
